package com.trxy.service.impl;

import com.trxy.mapper.ProductMapper;
import com.trxy.model.Product;
import com.trxy.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProductServiceImpl implements ProductService {

    @Autowired
    ProductMapper productMapper;

    @Override
    public List<Product> selectAll() {
        //return productMapper.selectByExample(new ProductExample());
        return productMapper.selectAll();
    }

    @Override
    public Product selectByPrimarykey(int id) {
        return productMapper.selectByPrimarykey(id);
    }

    @Override
    public int add(Product product) {
        return productMapper.add(product);
    }

    @Override
    public int edit(Product product) {
        return productMapper.edit(product);
    }

    @Override
    public int del(int id) {
        return productMapper.del(id);
    }
}
